
<div id="comentarios">
  <%- if element.comments.count != 0 -%>
    <%- for comment in element.comments -%>
      <%= render :partial => 'comentarios/comentario', :locals => { :comment => comment, :ajax => false } %>
    <%- end -%>
  <%- end -%>
  
  <script>
    function resaltar(){
      $("#comentario_body").attr( "value", "" );
      $(".comentario:last").show( "slow" );
    }
  </script>
  <div id="comentario_form">
    <% 
      form_remote_tag(
        :update => 'comentario_form', 
        :url => { :action => "comentar", :titulo_sanitizado => element.titulo_sanitizado  },
        :position => 'before',
        :complete =>" resaltar() "
      ) do
     %>
      <label for="author">Nombre:</label>
      <%= text_field 'comentario', 'author' %> <br />
    
      <label for="website">Web:</label>
      <%= text_field 'comentario', 'website' %> <br />
    
      <label for="body">Comentario:</label>
      <%= text_area 'comentario', 'body' %> <br />
    
      <div class="submit">
        <%= submit_tag "Comentar", :class => 'submit' %>
      </div>
    <% end %>
  </div><!-- comentario_form -->
</div><!-- comentarios -->